package org.jash.day3

/**
 * Created by Jash
 */
fun main() {
    val box = Box<Person>()
    var i = 78
    val s = when(i) {
        in 90..100 -> "优"
        in 80 until 90 -> "良"
        in 60 until 80 -> "可"
        in 0 until 60 -> "差"
        else -> "非法分数"
    }
    println(s)
    var p:Person = Student()
    box.t = p
    val name = when(p) {
        is Student -> "学生"
        is Worker -> "工人"
    }
    println(name)

}
//fun <T> getI():T {
//
//}